/*
 * Copyright 2016 Wealth Inc. All rights reserved.
 */
 package com.wealth.coupon.entity;


import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import com.fasterxml.jackson.annotation.JsonFormat;


/**
 * 优惠券规则
 * @author chan
 */
@Entity
@Table(name = "t_coupon_rule")
public class CouponRule implements Serializable {
	
	private static final long serialVersionUID = 1L;
	
	private Long id;
	private Double usageAmount;//面值
	private Double minAmount;	//最小订单金额
	private Date createTime;
	private Date startTime;
	private Date endTime;
	
	/* ---------------- method ----------------*/
	
	public CouponRule(){
	}

	public CouponRule(Long id){
		this.id = id;
	}

	/* ---------------- getter/setter ----------------*/
	
	
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	public Long getId() {
		return id;
	}
	
	public void setId(Long id) {
		this.id = id;
	}
	
	@Column(name = "usage_amount")
	public Double getUsageAmount() {
		return usageAmount;
	}
	
	public void setUsageAmount(Double usageAmount) {
		this.usageAmount = usageAmount;
	}
	
	
	@Column(name = "min_amount")
	public Double getMinAmount() {
		return minAmount;
	}

	public void setMinAmount(Double minAmount) {
		this.minAmount = minAmount;
	}

	@JsonFormat(pattern="yyyy-MM-dd",timezone = "GMT+8")  
	@Column(name = "create_time")
	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	@JsonFormat(pattern="yyyy-MM-dd",timezone = "GMT+8")  
	@Column(name = "start_time")
	public Date getStartTime() {
		return startTime;
	}

	public void setStartTime(Date startTime) {
		this.startTime = startTime;
	}

	@JsonFormat(pattern="yyyy-MM-dd",timezone = "GMT+8")  
	@Column(name = "end_time")
	public Date getEndTime() {
		return endTime;
	}

	public void setEndTime(Date endTime) {
		this.endTime = endTime;
	}
	
}



